package com.foreknow.mapping.impl;

import com.foreknow.mapping.EntityMapping;
import com.foreknow.model.Admin;

import java.sql.ResultSet;
import java.sql.SQLException;

public class AdminMapping implements EntityMapping {

    @Override
    public Object mapping(ResultSet rs) throws SQLException {
        Admin admin = new Admin();
        admin.setId(rs.getInt("id"));
        admin.setName(rs.getString("name"));
        admin.setSex(rs.getString("sex"));
        admin.setPassword(rs.getString("password"));
        return admin;
    }
}
